package com.goldfish666.remote_control.service.base;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.util.List;

public interface SimpleService<TEntity, TKey> extends BaseService<TEntity, TKey> {

    /**
     * 获取分页
     *
     * @param specification
     * @param pageable
     * @return
     */
    Page<TEntity> getPaged(Specification<TEntity> specification, Pageable pageable);


    /**
     * 根据条件获取主键集合
     *
     * @param specification
     * @return
     */
    List<TKey> getIdsByFilter(Specification<TEntity> specification);
}